// 创建Mapper接口（操作数据库的类）。使用 注解 实现增删改查，不用.xml的映射
package com.qut.system_1.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;


@Mapper // 添加了@Mapper注解之后这个接口在编译时会生成相应的实现类
public interface doctor_mapper {

    List<Map<String,Object>> search(@RequestParam Map<String,String> param);

    @Insert("insert into t_yisheng(Number,Name,Sex,Department,State,Phone)" +
            " values(#{Number},#{Name},#{Sex},#{Department},#{State},#{Phone})")
    int save(@RequestParam Map<String,String> param);

    @Update("update t_yisheng"+
            " set Name=#{Name},"+
            " Sex=#{Sex},"+
            " Department=#{Department},"+
            " State=#{State},"+
            " Phone=#{Phone}"+
            " where Number=#{Number}")
    int edit(@RequestParam Map<String,String> param);

    int delete(String[] ids);

}
